import defaultSettings from '@/settings'
import i18n from '@/lang'

// 读取settings.js配置文件，获取浏览器标签标题
const title = defaultSettings.title || 'Vue Element Admin'

// i18n国际化语言翻译浏览器标签标题
export default function getPageTitle(key) {
  const hasKey = i18n.te(`route.${key}`)
  if (hasKey) {
    const pageName = i18n.t(`route.${key}`)
    return `${pageName} - ${title}`
  }
  return `${title}`
}
